import Vue from 'vue'
import Router from 'vue-router'
// eslint-disable-next-line no-unused-vars
import Page from '@/views/config/page'

Vue.use(Router)

export default new Router({
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: () => import('@/views/Home.vue'),
      children: [
        {
          path: '/home',
          name: 'Home',
          meta: { title: '首页', icon: 'dashboard', affix: true },
          component: () => import('@/views/Home.vue')
        }
      ]
    },
    {
      path: '/header',
      name: 'Header',
      meta: {
        title: 'header'
      },
      component: () => import('@/components/Header.vue')
    },
    {
      path: '/page',
      name: 'Page',
      meta: {
        title: 'page'
      },
      component: () => import('@/views/config/page.vue')
    },
    {
      path: '/edit',
      name: 'Edit',
      meta: {
        title: 'edit'
      },
      component: () => import('@/views/config/edit.vue')
    },
    {
      path: '/replace',
      name: 'Replace',
      meta: {
        title: 'replace'
      },
      component: () => import('@/views/config/replace.vue')
    },
    {
      path: '/basic',
      name: 'basic',
      meta: {
        title: 'basic'
      },
      component: () => import('@/views/config/basicConfig.vue')
    },
    {
      path: '/history',
      name: 'History',
      meta: {
        title: 'history'
      },
      component: () => import('@/views/history/ConfigHistorySearch.vue')
    },
    {
      path: '/historyDetail',
      name: 'History',
      meta: {
        title: 'history'
      },
      component: () => import('@/views/history/ConfigHistoryDetail.vue')
    },
    {
      path: '/file',
      name: 'file',
      meta: {
        title: 'file'
      },
      component: () => import('@/views/config/excelShow.vue')
    },
    {
      path: '/configConfirm',
      name: 'configConfirm',
      meta: {
        title: 'configConfirm'
      },
      component: () => import('@/views/config/ConfigConfirm.vue')
    },
    {
      path: '/roleGroup',
      name: 'roleGroup',
      meta: {
        title: 'roleGroup'
      },
      component: () => import('@/views/role/roleGroup.vue')
    },
    {
      path: '/dict',
      name: 'dict',
      meta: {
        title: 'dict'
      },
      component: () => import('@/views/dict/dict.vue')
    }
  ]
})
